//获取应用实例
let conf = require('../../app.config').app
Page({

  data: {
    getInitPageInfo:{},
    isSkip: false,
    timeId: null,
    text: "跳过",
    is_tiao:0,
  },

  async onLoad(option) {
    let that = this;
    if(option.share_openid){
      wx.setStorageSync('share_openid', option.share_openid);
      console.log(option.share_openid+"===========");
    }
    that.api.login()

    that.api.interface.getInitPageInfo().then(res=>{
      that.setData({
        getInitPageInfo: res.data.data,
        buttonimg :res.data.data.buttonImg ? res.data.data.buttonImg :''
      })
      that.setData({
        autoplay: res.data.data.isAutoOff == 0 ? false : true
      })
      console.log(res,'开屏页信息- - - -- - - 》》》')
      if(res.data.data.urlType == 1){
        if(res.data.data.isAutoOff == 1){
          (this.id=setTimeout(() => {
            !this.data.isSkip &&this.onskip()
          }, 3000))
        }
      }
    })
  },

  onskip() {
    if(this.data.is_tiao == 0){
      wx.redirectTo({
        url: '../home/home'
      })
    }

  },
  onUnload(){
    this.setData({
      is_tiao: 1
    });
  },
  onShareAppMessage() {

  },
  /**
   * 用户点击右上角分享
   */

})